package org.example.infrastructure.persistence;

import org.example.domain.system.model.UserAccount;
import org.example.infrastructure.persistence.fallbackFactory.RemoteUserAccountFallbackFactory;
import org.example.web.result.ResultInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Optional;


@FeignClient(value = "url-shortener-domain", contextId = "RemoteUserAccountPersistence", path = "/url-shortener-domain/api/domain/v1", fallbackFactory = RemoteUserAccountFallbackFactory.class)
public interface RemoteUserAccountPersistence {

    @GetMapping("/user/getUserAccountByUserName")
    Optional<ResultInfo<UserAccount>> getUserByUserName(@RequestParam String userName);
}
